<template>
  <div class="merch-content">
    <div>
      <h3>{{ merch.title }}</h3>
      <div class="merch-date">
        <span>{{ merch.author }}</span>
        <p>{{ merch.createTime }}</p>
        <p>{{ merch.visit }}</p>
      </div>
      <h4 v-html="merch.content"></h4>
    </div>
  </div>
</template>

<script>
export default {
  name: "MerchInfo",

  data() {
    return {
      merch: {},
    };
  },

  methods: {},
  async created() {
    // https://apif.java.crmeb.net/api/front/article/info?id=23
    await this.$requestTools("/crmeb/article/info", "GET", {
      params: {
        id: 23,
      },
    }).then(({ data: { data } }) => {
      this.merch = data;
      console.log(this.merch);
    });
  },
};
</script>

<style lang="scss" scoped>
.merch-content {
  width: 100%;
  height: 100vh;
  background-color: #eee;
  > div {
    padding: 10px;

    background-color: #fff;
    h3 {
      font-size: 14px;
    }
    .merch-date {
      margin-top: 10px;
      display: flex;
      align-items: center;
      color: gray;
      span {
        font-size: 14px;
      }
      p {
        margin-left: 15px;
      }
    }
    h4 {
      margin-top: 10px;
      font-weight: normal;
      font-size: 13px;
      text-align: justify;
    }
  }
}
</style>
